﻿<%@ WebHandler Language="C#"  Class="ChangeCaName" %>

using System;
using System.Collections.Generic;
using System.Web;
using SalePartial.BLL;
using SalePartial.Model;

/// <summary>
/// $codebehindclassname$ 的摘要说明
/// </summary>

public class ChangeCaName : IHttpHandler
{

    public void ProcessRequest(HttpContext context)
    {
        context.Response.ContentType = "text/plain";
        Guid caid ;
        string caname = context.Request.QueryString["caname"];
        caname = context.Server.HtmlDecode(caname);     //转码
        string id = context.Request.QueryString["caid"];
        if (id!=null && id != string.Empty)
        {
            caid = new Guid(id);
            //更新数据库类别名称
            XPNewsCateGory bca = new XPNewsCateGory();
            XPNewsCateGoryInfo mc = new XPNewsCateGoryInfo();
            mc.CaID = caid;
            mc.CaName = caname;

            if (bca.Update(mc)==0)
            {
                context.Response.Write("true");
            }
            else
            { context.Response.Write("false"); }
        }
        else
        {
            context.Response.Write("false");
        }

        //  context.Response.Write(caneme);
    }

    public bool IsReusable
    {
        get
        {
            return false;
        }
    }
}
